package org.brisling.medical.queryService;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.brisling.base.domain.ListDomain;
import org.brisling.base.service.AbstractBaseQueryService;
import org.brisling.common.ConstSysParam;
import org.brisling.medical.domain.InpatientFee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * 
 * <p>
 * Title: QueryInpatientFeeService
 * </p>
 * <p>
 * Description: 住院费用查询
 * </p>
 * <p>
 * Company: 长沙东勤信息科技发展有限公司
 * </p>
 * 
 * @author shura
 * @since 1.0
 * @version 1.0
 * @date 2016年7月20日 下午10:04:43
 */
@RestController
@RequestMapping("/medicalInpatientFee/query")
public class QueryInpatientFeeService extends AbstractBaseQueryService<InpatientFee> {

	public QueryInpatientFeeService() {
		this.moduleName = ConstSysParam.MODULE_INPATIENT_ITEM;
		this.subSystem = ConstSysParam.SUBSYSTEM_MEDICAL;
		this.tableName = ConstSysParam.VIEW_PREFIX + this.getTableName(InpatientFee.class);
		this.clazz = InpatientFee.class;

		typeMap = this.getTypeMap(clazz);

		orderMap.put("feeat", "desc");

	}

	@PersistenceContext(unitName = ConstSysParam.SUBSYSTEM_SYSMAN)
	@Autowired
	protected void setEntityManager(EntityManager entityManager) {
		this.entityManager = entityManager;
	}

	@RequestMapping("/mainPage.action")
	public ModelAndView getMainPage() {
		return this.getBizMainPage();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.brisling.service.sysman.DepartmentServiceInf#getEditPage()
	 */
	@RequestMapping("/editPage.action")
	public ModelAndView getEditPage() {
		return this.getBizEditPage();
	}

	@RequestMapping("/getListDomain.action")
	public ListDomain<InpatientFee> getListDomain(@RequestBody(required = false) String body) {

		return super.getListDomainByConditionAndOrder(body, typeMap, orderMap, false);

	}

	@RequestMapping("/getList.action")
	public ListDomain<InpatientFee> getList(@RequestBody(required = false) String body) {

		return super.getListDomainByConditionAndOrder(body, typeMap, orderMap, false);
	}

	/**
	 * 根据用户id查找用户信息
	 * 
	 * @param id
	 *            用户id
	 * @return 用户信息记录
	 */
	@RequestMapping("/getOne.action")
	public InpatientFee getOne(@RequestParam(value = "id", required = false) Long id) {
		return super.getOne(id);
	}

	/**
	 * 根据用户唯一编码查找用户信息
	 * 
	 * @param identify
	 *            用户唯一编码
	 * @return 用户信息记录
	 */
	@RequestMapping("/getOneByIdentify.action")
	public InpatientFee getOneByIdentify(@RequestParam(value = "identify", required = false) String identify) {
		return super.getOneByIdentify(identify);
	}

}
